/*
 * Copyright (C) 2022 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef GETTASKBARVALUE_H
#define GETTASKBARVALUE_H

#include <QObject>
#include <QGuiApplication>
#include <QMap>
#include "core/modelmanager.h"
#include "appmanager_interface.h"
#include "windowmanager/windowmanager.h"
#include "windowmanager/windowinfo.h"

class LauncherItem;
class ModelManagerPrivate;
class ModelManager;

class TaskBarManager : public QObject
{
    Q_OBJECT
public:
    explicit TaskBarManager(ModelManager *parent = nullptr);
    ~TaskBarManager() = default;

    void setWindowDesktopFileName(quint32 wid, const QString &fileName);

public slots:
    void handleAppClosed(kdk::WindowId wid);
    void updateWindowOpenInformation(QString desktopName, qlonglong pid, uint wid);

private:
    void initConnections();
    void saveWindowWid(QString desktopName, int wid);

private:
    QMap<QString, QList<WId>> m_isOpenWindows;
    ModelManager *m_taskbarModelManager;
    ComKylinAppManagerInterface *m_appManagerInterface;
};

#endif // GETTASKBARVALUE_H
